package cn.edu.sjtu.process_management.util;

import com.auth0.jwt.JWT;


/**
 * @author loumoon
 * @date 2019-11-07 19:01
 */
public class JWTUtil {

    public static String decodeUserId(String token) {
        return JWT.decode(token).getAudience().get(0);
    }

    public static Integer decodeRole(String token) {
        return JWT.decode(token).getClaim("role").asInt();
    }

}
